new file defining BABL_DETECT_CFLAGS() macro.
authorSven Neumann <sven@gimp.org>
Sun, 6 Apr 2008 11:53:24 +0000 (11:53 +0000)
committerSven Neumann <neo@src.gnome.org>
Sun, 6 Apr 2008 11:53:24 +0000 (11:53 +0000)
2008-04-06  Sven Neumann  <sven@gimp.org>

* acinclude.m4: new file defining BABL_DETECT_CFLAGS() macro.

* configure.ac: set CFLAGS to get some extra compiler warnings.

* babl/babl-fish-stats.c (conversions): fixed old-style function
definition.

* Makefile.am: formatting.

svn path=/trunk/; revision=303

ChangeLog
Makefile.am
acinclude.m4 [new file with mode: 0644]
babl/babl-fish-stats.c
configure.ac

index 6287e3112cb77f80e8798eaf3f7d5e22cf06d9ec..550b4e9bb02c8cd0101edd886bf3a9143bad1695 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2008-04-06  Sven Neumann  <sven@gimp.org>
+
+       * acinclude.m4: new file defining BABL_DETECT_CFLAGS() macro.
+
+       * configure.ac: set CFLAGS to get some extra compiler warnings.
+
+       * babl/babl-fish-stats.c (conversions): fixed old-style function
+       definition.
+
+       * Makefile.am: formatting.
+
 2008-04-02  Mukund Sivaraman <muks@mukund.org>
 
        Sparse fixes.
index 511c63982b4df787db56d084dd6b4294bf6fbfb4..0059faf7eab8b0f9ca17f312e19467afbe5cd6b2 100644 (file)
@@ -1,9 +1,10 @@
 AUTOMAKE_OPTIONS = foreign dist-bzip2
 
-SUBDIRS = babl         \
-         extensions    \
-         tests         \
-         docs
+SUBDIRS = \
+       babl            \
+       extensions      \
+       tests           \
+       docs
 
 pkgconfigdir = $(libdir)/pkgconfig
 pkgconfig_DATA = babl.pc
diff --git a/acinclude.m4 b/acinclude.m4
new file mode 100644 (file)
index 0000000..3fad630
--- /dev/null
@@ -0,0 +1,20 @@
+dnl BABL_DETECT_CFLAGS(RESULT, FLAGSET)
+dnl Detect if the compiler supports a set of flags
+
+AC_DEFUN([BABL_DETECT_CFLAGS],
+[
+  $1=
+  for flag in $2; do
+    if test -z "[$]$1"; then
+      $1_save_CFLAGS="$CFLAGS"
+      CFLAGS="$CFLAGS $flag"
+      AC_MSG_CHECKING([whether [$]CC understands [$]flag])
+      AC_TRY_COMPILE([], [], [$1_works=yes], [$1_works=no])
+      AC_MSG_RESULT([$]$1_works)
+      CFLAGS="[$]$1_save_CFLAGS"
+      if test "x[$]$1_works" = "xyes"; then
+        $1="$flag"
+      fi
+    fi
+  done
+])
index 52daf991df4c91a7e70e74650f8991b046996bde..64dd7683928620a0f7168f9756e3f931c27275fa 100644 (file)
@@ -231,7 +231,7 @@ each_conv (Babl *babl,
 }
 
 static void
-conversions ()
+conversions (void)
 {
   fprintf (output_file, "<h2>Conversions</h2><dl>\n");
   babl_conversion_each (each_conv, NULL);
index fada2b2aea1f1193fa730ad9e523c598df88fb66..3e7a2cbbc36e4ffefbd44ce103e1cf44ed5c5d2b 100644 (file)
@@ -105,6 +105,7 @@ AC_SUBST(WEBSITE_HOST)
 WEBSITE_LOCATION=public_html/babl/
 AC_SUBST(WEBSITE_LOCATION)
 
+
 if eval "test x$GCC = xyes"; then
   case " $CFLAGS " in
   *[\ \        ]-Wall[\ \      ]*) ;;
@@ -112,6 +113,25 @@ if eval "test x$GCC = xyes"; then
   esac
 fi
 
+BABL_DETECT_CFLAGS(extra_warnings, '-Wdeclaration-after-statement')
+CFLAGS="$CFLAGS $extra_warnings"
+
+BABL_DETECT_CFLAGS(extra_warnings, '-Wmissing-prototypes')
+CFLAGS="$CFLAGS $extra_warnings"
+
+BABL_DETECT_CFLAGS(extra_warnings, '-Wmissing-declarations')
+CFLAGS="$CFLAGS $extra_warnings"
+
+BABL_DETECT_CFLAGS(extra_warnings, '-Winit-self')
+CFLAGS="$CFLAGS $extra_warnings"
+
+BABL_DETECT_CFLAGS(extra_warnings, '-Wpointer-arith')
+CFLAGS="$CFLAGS $extra_warnings"
+
+BABL_DETECT_CFLAGS(extra_warnings, '-Wold-style-definition')
+CFLAGS="$CFLAGS $extra_warnings"
+
+
 AC_PATH_PROG(INKSCAPE, inkscape, no)
 AM_CONDITIONAL(HAVE_INKSCAPE, test "x$INKSCAPE" != "xno")